package IO;


import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * @author: wh(1835734390 @ qq.com)
 * @date: 2023/8/29 19:36
 * @description:
 * @version:
 */
public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int u = scanner.nextInt();
        int v = scanner.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }
        Map<Long,Integer> prefixSumCount = new HashMap<>();
        long prefixSum = 0;
        int count = 0;
        for (int i = 0; i < n; i++) {
            prefixSum += arr[i];
            long key = prefixSum * v - (long) u * (i + 1);
            if (key == 0) {
                count++;
            }
            if (prefixSumCount.containsKey(key)) {
                count += prefixSumCount.get(key);
            }
            prefixSumCount.put(key,prefixSumCount.getOrDefault(key,0) + 1);
        }
        System.out.println(count);
    }

}
